package org.trebert.j2ee;
import java.io.*;
import java.util.*;

public class ZaehlBean implements Serializable{
	
	public ZaehlBean(){
		this.zaehler = 0;
		this.map = new HashMap<String, Integer>();
		map.put("eins", new Integer(1));
	}
	
	public boolean isValid(){
		boolean ret = true;
		for (String key : map.keySet()){
			if (map.get(key) < 0){
				ret = false;
			}
		}
		return ret;
	}

	private Map<String, Integer> map;
	public Map<String, Integer> getMap(){
		return map;
	}
	public void setMap(Map<String, Integer> map){
		this.map = map;
	}
	
	private int zaehler;
	public int getZaehler(){
		return zaehler;
	}
	public void setZaehler(int zaehler){
		this.zaehler = zaehler;
	}

	public void rauf(){
		zaehler++;
	}
	public void runter(){
		zaehler--;
	}
}
